<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table cellspacing="0" border="0" width="995">
	<tr>
		<td width="995" class="title_manager_product">Quản lý hỗ trợ trực tuyến</td>
	</tr>
	<tr>
		<td height="90">
			<table border="0" cellpadding="0" cellspacing="0" width="995">
				<tr>
					<td align="center">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="center"><a href="index.php?admin=supportAdmin&do=formaddsupportcategory"><img src="images/CreateNews.gif" width="48" height="47" border="0" /></a></td>
							</tr>
							<tr>
								<td align="center" class="title_new_add"><a href="index.php?admin=supportAdmin&do=formaddsupportcategory">Tạo danh mục hỗ trợ</a></td>
							</tr>
						</table>
						
					</td>
				</tr>
			</table>
		</td>	
	</tr>
</table>

<table class="reference" cellspacing="0" border="0" width="995">
	<tr>
		
		<td width="995">
			<?php
				$id=$_GET['id'];
			?>
			<form action="index.php?admin=supportAdmin&do=formeditfile&id=<?php echo $id;?>" method="post">
				<table cellspacing="0" border="0" width="995">
					<tr>
						<td width="995" class="title_manager_product">Sửa thông tin người hỗ trợ</td>
					</tr>
				</table>
				<table class="reference" cellspacing="0" border="1" width="100%">
					<tr>
						<td colspan="2" align="center">
							<?php
								$id=$_GET['id'];
								$idyahoo = $_POST['idyahoo'];
								$namesupport = $_POST['namesupport'];
								
								//$target="../download/";
								//$files = $_FILES['filelink']['name'];
								//$link=$target.$files;
								
								
								if(isset($_POST['submit'])){
									/*
									move_uploaded_file($_FILES['filelink']['tmp_name'],$link);
									if($files==''){
										$query="UPDATE productdownloads SET cateID='$cateID',filename='$filename' WHERE id=$id";		
									}else{
										$query="UPDATE productdownloads SET cateID='$cateID',filename='$filename',filelink='$link' WHERE id=$id";		
									}
									*/
									if($idyahoo==''){
										echo "<font color=\"red\">Bạn phải chọn ID Yahoo người hỗ trợ.</font>";
									}else{
										$query="UPDATE productdownloadcategories SET idyahoo='$idyahoo',namesupport='$namesupport' WHERE id=$id";
										mysql_query($query);
										echo "Sửa người hỗ trợ thành công.";
										echo "<script>window.location='index.php?admin=supportAdmin&do=listsupport'</script>";		
									}
								}
								
							?>
						</td>
					</tr>
					<?php 
						
						$query="SELECT * FROM productdownloadcategories WHERE id=$id";
						$result=mysql_query($query);
						while($row = mysql_fetch_array($result)){?>
							<tr><td height="20"></td></tr>
							<tr>
								<td align="right"><b>ID Yahoo:</b></td>
								<td><input type="text" name="idyahoo" size="30" value="<?php echo $row['idyahoo']?>" /></td>
							</tr>
							
							<tr>
								<td align="right"><b>Tên người hỗ trợ::</b></td>
								<td><input type="text" name="namesupport" size="30" value="<?php echo $row['namesupport']?>" /></td>
							</tr>
							<tr>
								<td></td>
								<td>
									<input type="submit" name="submit" value="Sửa người hỗ trợ" />
									<input type="button" name="Cancel" value="Cancel" onclick="window.location = 'index.php?admin=supportAdmin&do=listsupport' " /> 
								</td>
							</tr>
						<?php
						}
						?>	        	
				</table>
			</form>
		</td>
	</tr>	
</table>
</body>
</html>